package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 库位管理表
 * @TableName warehouse_location
 */
@TableName(value ="warehouse_location")
@Data
public class WarehouseLocation implements Serializable {
    /**
     * 库位编号
     */
    @TableId(type = IdType.AUTO)
    private Integer warehouseLocationId;

    /**
     * 库位编码
     */
    private String warehouseLocationCode;

    /**
     * 库位名称
     */
    private String warehouseLocationName;

    /**
     * 面积
     */
    private BigDecimal area;

    /**
     * 最大载重量
     */
    private BigDecimal payload;

    /**
     * 状态（是否启用）
     */
    private String status;

    /**
     * 库区id
     */
    private Long warehouseAreaId;

    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WarehouseLocation other = (WarehouseLocation) that;
        return (this.getWarehouseLocationId() == null ? other.getWarehouseLocationId() == null : this.getWarehouseLocationId().equals(other.getWarehouseLocationId()))
            && (this.getWarehouseLocationCode() == null ? other.getWarehouseLocationCode() == null : this.getWarehouseLocationCode().equals(other.getWarehouseLocationCode()))
            && (this.getWarehouseLocationName() == null ? other.getWarehouseLocationName() == null : this.getWarehouseLocationName().equals(other.getWarehouseLocationName()))
            && (this.getArea() == null ? other.getArea() == null : this.getArea().equals(other.getArea()))
            && (this.getPayload() == null ? other.getPayload() == null : this.getPayload().equals(other.getPayload()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getWarehouseAreaId() == null ? other.getWarehouseAreaId() == null : this.getWarehouseAreaId().equals(other.getWarehouseAreaId()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getWarehouseLocationId() == null) ? 0 : getWarehouseLocationId().hashCode());
        result = prime * result + ((getWarehouseLocationCode() == null) ? 0 : getWarehouseLocationCode().hashCode());
        result = prime * result + ((getWarehouseLocationName() == null) ? 0 : getWarehouseLocationName().hashCode());
        result = prime * result + ((getArea() == null) ? 0 : getArea().hashCode());
        result = prime * result + ((getPayload() == null) ? 0 : getPayload().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getWarehouseAreaId() == null) ? 0 : getWarehouseAreaId().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", warehouseLocationId=").append(warehouseLocationId);
        sb.append(", warehouseLocationCode=").append(warehouseLocationCode);
        sb.append(", warehouseLocationName=").append(warehouseLocationName);
        sb.append(", area=").append(area);
        sb.append(", payload=").append(payload);
        sb.append(", status=").append(status);
        sb.append(", warehouseAreaId=").append(warehouseAreaId);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}